package com.xiaoshuidi.cloud.module.contract.dal.mysql.contract;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaoshuidi.cloud.framework.mybatis.core.mapper.BaseMapperX;
import com.xiaoshuidi.cloud.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.ContractExtrasDataDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 合同杂费 Mapper
 *
 * @author 合房租赁
 */
@Mapper
public interface ContractExtrasDataMapper extends BaseMapperX<ContractExtrasDataDO> {

    default List<ContractExtrasDataDO> getExtrasDatalist(Long feeTypeId) {
        return selectList(new LambdaQueryWrapperX<ContractExtrasDataDO>()
                .eq(ContractExtrasDataDO::getContractId, feeTypeId));
    }

    default int deleteByContractId(Long contractId) {
        return delete(new QueryWrapper<ContractExtrasDataDO>().eq("contract_id", contractId));
    }
}
